<?php 
defined('IN_ADMIN') or exit('No permission resources.');
include $this->admin_tpl('header', 'admin');
?>
<div class="subnav">
    <div class="content-menu ib-a blue line-x">
    	    <a href="?m=formguide&c=formguide_teacher_search&a=init&formid=<?php echo $formid?>"><?php echo '搜索';?></a><span>|</span>
    	    <a href="?m=formguide&c=formguide_teacher_info&a=init&formid=<?php echo $formid?>"><?php echo '信息列表';?></a><span>|</span>
        	<a href="?m=formguide&c=formguide_teacher_info&a=verify&formid=<?php echo $formid?>"><?php echo '审核信息';?></a>
    </div>
</div>
<div class="pad-lr-10">
<form name="myform" action="?m=formguide&c=formguide_teacher_info&a=delete" method="post">
<div class="table-list">
<table width="100%" cellspacing="0">
  <thead>
            <tr>
            <th width="35" align="center"><input type="checkbox" value="" id="check_box" onclick="selectall('did[]');"></th>
            <th align="center"> 工号</th>
    		<th align="center"> 姓名</th>
    		<th align="center"> 专业</th>
			<?php foreach($fields as $key=>$v){ $k++; if($k<4){ ?><th align="center"><?php echo $v['name'];?> </th><?php }}?>
			<th  align="center"><?php echo L('times')?></th>
			<th  align="center"><?php echo '状态'?></th>
			<th  align="center"><?php echo L('operation')?></th>
            </tr>
        </thead>
    <tbody>
 <?php 
if(is_array($datas)){



	foreach($datas as $kk=>$d){		
	//读取教师数据表
	$tea_data=$this->tea_adb->get_one(array('answerId'=>$d['dataid'], 'formid'=>$formid,'pass'=>0));
	if($tea_data){
?>   
	<tr>
	<td align="center">
	<input type="checkbox" name="did[]" value="<?php echo $d['dataid']?>">
	</td>
	<td align="center"><?php echo $tea_data['number'];?> </td>
    <td align="center"><?php echo $tea_data['name'];?></td>
    <td align="center"><?php echo $tea_data['major'];?> </td>
	<td align="center"><?php echo htmlspecialchars_decode(str_replace("\\","",$d[$fary[0]]));?> </td>
    <td align="center"><?php echo htmlspecialchars_decode(str_replace("\\","",$d[$fary[1]]));?> </td>
    <td align="center"><?php echo htmlspecialchars_decode(str_replace("\\","",$d[$fary[2]]));?> </td>
	<!-- <td align="center"><?php //echo htmlspecialchars_decode(str_replace("\\","",$d[$fary[5]]));?> </td> -->
	<td align="center"><?php echo date('Y-m-d', $d['datetime'])?></td>
	<td align="center"><?php if($tea_data['pass']=='1'){echo '通过';}else{echo '待审';}?></td>
	<td align="center">
		<a href="javascript:check('<?php echo $formid?>', '<?php echo $d['dataid']?>', '<?php echo safe_replace($tea_data['number'])?>');void(0);"><?php echo L('check')?></a> |
		<a href="?m=formguide&c=formguide_teacher_info&a=public_edit&formid=<?php echo $formid?>&did=<?php echo $d['dataid']?>"><?php echo L('edit')?></a>| 
		<?php if($tea_data['pass']=='0'){?>
            <a style="color:green; font-weight:bold;" href='?m=formguide&c=formguide_teacher_info&a=state&pass=1&formid=<?php echo $formid?>&did=<?php echo $d['dataid']?>' onClick="return confirm('您确定要通过吗?')">通过</a> |
            <?php }else{?>  
            <a style="color:red; font-weight:bold;" href='?m=formguide&c=formguide_teacher_info&a=state&pass=0&formid=<?php echo $formid?>&did=<?php echo $d['dataid']?>' onClick="return confirm('您确定要待审吗?')">待审</a> |
        <?php }?>  
		<a href="?m=formguide&c=formguide_teacher_info&a=public_delete&formid=<?php echo $formid?>&did=<?php echo $d['dataid']?>" onClick="return confirm('<?php echo L('confirm', array('message' => L('delete')))?>')"><?php echo L('del')?></a></td>
	</tr>
<?php 

	}}
}
?>
</tbody>
    </table>
  
    <div class="btn"><label for="check_box"><?php echo L('selected_all')?>/<?php echo L('cancel')?></label>
		<input name="submit" type="submit" class="button" value="<?php echo L('remove_all_selected')?>" onClick="document.myform.action='?m=formguide&c=formguide_teacher_info&a=public_delete&formid=<?php echo $formid?>';return confirm('<?php echo L('affirm_delete')?>')">&nbsp;&nbsp;</div>  </div>
 <div id="pages"><?php echo $pages;?></div>
</form>
</div>
</body>
</html>
<script type="text/javascript">
function check(id, did, title) {
	window.top.art.dialog({id:'check'}).close();
	window.top.art.dialog({title:'<?php echo L('check')?>--'+title+'<?php echo L('submit_info')?>', id:'edit', iframe:'?m=formguide&c=formguide_teacher_info&a=public_view&formid='+id+'&did='+did ,width:'700px',height:'500px'}, function(){window.top.art.dialog({id:'check'}).close()});
}
</script>